// 防抖函数,在一定时间内只执行一次函数
function thro (fun, time) {
	if (time == null || time == undefined) {
		time = 300
	}
	let lastTime = null
	return function () {
		let nowTime = new Date()
		if(nowTime - lastTime > time || !lastTime) {
			fun.apply(this, arguments);
			lastTime = nowTime
		}
	}
}

export default thro